.class public Lcom/netease/newsreader/activity/SkinSettingActivity;
.super Landroid/app/Activity;
.source "SkinSettingActivity.java"


# static fields
.field public static final LABLE:Ljava/lang/String; = "lable"

.field public static final VALUE:Ljava/lang/String; = "value"


# instance fields
.field private btns:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Landroid/widget/Button;",
            ">;"
        }
    .end annotation
.end field

.field private cancelBtn:Landroid/widget/Button;

.field private rbs:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Landroid/widget/RadioButton;",
            ">;"
        }
    .end annotation
.end field

.field private skinLable:[Ljava/lang/String;

.field private skinList:Landroid/widget/ListView;

.field private skinValue:[Ljava/lang/String;

.field private sp:Landroid/content/SharedPreferences;


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 22
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    return-void
.end method


# virtual methods
.method protected onCreate(Landroid/os/Bundle;)V
    .locals 6
    .parameter "savedInstanceState"

    .prologue
    .line 37
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 38
    const/4 v4, 0x1

    invoke-virtual {p0, v4}, Lcom/netease/newsreader/activity/SkinSettingActivity;->requestWindowFeature(I)Z

    .line 39
    const v4, 0x7f030069

    invoke-virtual {p0, v4}, Lcom/netease/newsreader/activity/SkinSettingActivity;->setContentView(I)V

    .line 41
    invoke-static {p0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v4

    iput-object v4, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->sp:Landroid/content/SharedPreferences;

    .line 43
    const v4, 0x7f0c0155

    invoke-virtual {p0, v4}, Lcom/netease/newsreader/activity/SkinSettingActivity;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/ListView;

    iput-object v4, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->skinList:Landroid/widget/ListView;

    .line 44
    invoke-virtual {p0}, Lcom/netease/newsreader/activity/SkinSettingActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    const/high16 v5, 0x7f07

    invoke-virtual {v4, v5}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;

    move-result-object v4

    iput-object v4, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->skinLable:[Ljava/lang/String;

    .line 45
    invoke-virtual {p0}, Lcom/netease/newsreader/activity/SkinSettingActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    const v5, 0x7f070001

    invoke-virtual {v4, v5}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;

    move-result-object v4

    iput-object v4, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->skinValue:[Ljava/lang/String;

    .line 46
    const v4, 0x7f0c0156

    invoke-virtual {p0, v4}, Lcom/netease/newsreader/activity/SkinSettingActivity;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/Button;

    iput-object v4, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->cancelBtn:Landroid/widget/Button;

    .line 48
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    .line 49
    .local v1, data:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;>;"
    const/4 v2, 0x0

    .local v2, i:I
    :goto_0
    iget-object v4, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->skinLable:[Ljava/lang/String;

    array-length v4, v4

    if-lt v2, v4, :cond_0

    .line 57
    new-instance v0, Lcom/netease/newsreader/util/SkinSettingAdapter;

    iget-object v4, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->skinList:Landroid/widget/ListView;

    invoke-direct {v0, p0, v1, v4}, Lcom/netease/newsreader/util/SkinSettingAdapter;-><init>(Landroid/content/Context;Ljava/util/List;Landroid/widget/ListView;)V

    .line 58
    .local v0, adapter:Lcom/netease/newsreader/util/SkinSettingAdapter;
    iget-object v4, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->skinList:Landroid/widget/ListView;

    invoke-virtual {v4, v0}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 60
    invoke-virtual {v0}, Lcom/netease/newsreader/util/SkinSettingAdapter;->getmRaidos()Ljava/util/List;

    move-result-object v4

    iput-object v4, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->rbs:Ljava/util/List;

    .line 61
    invoke-virtual {v0}, Lcom/netease/newsreader/util/SkinSettingAdapter;->getmButtons()Ljava/util/List;

    move-result-object v4

    iput-object v4, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->btns:Ljava/util/List;

    .line 63
    iget-object v4, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->cancelBtn:Landroid/widget/Button;

    new-instance v5, Lcom/netease/newsreader/activity/SkinSettingActivity$1;

    invoke-direct {v5, p0}, Lcom/netease/newsreader/activity/SkinSettingActivity$1;-><init>(Lcom/netease/newsreader/activity/SkinSettingActivity;)V

    invoke-virtual {v4, v5}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 70
    return-void

    .line 50
    .end local v0           #adapter:Lcom/netease/newsreader/util/SkinSettingAdapter;
    :cond_0
    new-instance v3, Ljava/util/HashMap;

    invoke-direct {v3}, Ljava/util/HashMap;-><init>()V

    .line 51
    .local v3, map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;"
    const-string v4, "lable"

    iget-object v5, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->skinLable:[Ljava/lang/String;

    aget-object v5, v5, v2

    invoke-interface {v3, v4, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 52
    const-string v4, "value"

    iget-object v5, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->skinValue:[Ljava/lang/String;

    aget-object v5, v5, v2

    invoke-interface {v3, v4, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 54
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 49
    add-int/lit8 v2, v2, 0x1

    goto :goto_0
.end method

.method protected onResume()V
    .locals 4

    .prologue
    .line 74
    invoke-super {p0}, Landroid/app/Activity;->onResume()V

    .line 76
    iget-object v2, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->rbs:Ljava/util/List;

    if-eqz v2, :cond_0

    iget-object v2, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->rbs:Ljava/util/List;

    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v2

    if-lez v2, :cond_0

    iget-object v2, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->btns:Ljava/util/List;

    if-eqz v2, :cond_0

    iget-object v2, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->btns:Ljava/util/List;

    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v2

    if-lez v2, :cond_0

    .line 77
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    iget-object v2, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->skinValue:[Ljava/lang/String;

    array-length v2, v2

    if-lt v0, v2, :cond_1

    .line 85
    .end local v0           #i:I
    :cond_0
    invoke-static {}, Lcom/netease/newsreader/util/SkinUtil;->deleteSkinApkFiles()V

    .line 86
    return-void

    .line 78
    .restart local v0       #i:I
    :cond_1
    iget-object v2, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->skinValue:[Ljava/lang/String;

    aget-object v2, v2, v0

    invoke-static {v2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v1

    .line 79
    .local v1, id:I
    invoke-static {p0, v1}, Lcom/netease/newsreader/util/SkinUtil;->isPkgInstalled(Landroid/content/Context;I)Z

    move-result v2

    if-eqz v2, :cond_2

    .line 80
    iget-object v2, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->rbs:Ljava/util/List;

    invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/widget/RadioButton;

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Landroid/widget/RadioButton;->setVisibility(I)V

    .line 81
    iget-object v2, p0, Lcom/netease/newsreader/activity/SkinSettingActivity;->btns:Ljava/util/List;

    invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/widget/Button;

    const/4 v3, 0x4

    invoke-virtual {v2, v3}, Landroid/widget/Button;->setVisibility(I)V

    .line 77
    :cond_2
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method
